package jvm;

/**
 * @Author:ycz
 * @date:2021/7/20
 */
public class Test2 {

    public static void main(String[] args) {
        System.out.println(B.str);
    }

    static class A{
        // 会被打印出来
        // 因为B一定会去加载其父类
        static {
            System.out.println("this is A class");
        }
    }

    static class B extends A{
        public static String str = "B str";
        static {
            System.out.println("this is B class");
        }
    }



}
